/**
 *
 */
package demo.tellurium.module

import groovy.lang.MetaClass;


import demo.tellurium.framework.BaseUIModule;

/**
 * @author roger.xu
 *
 */
class ListModule extends BaseUIModule {

    @Override
    public void defineUi() {
        ui.Container(uid: "ListExample") {
            List(uid: "LinkList", clocator: [tag: "ul"], separator: "li") {
                UrlLink(uid: "{all}", clocator: [:]) // if define a clocator, jquery=[ul > li:eq(1) > a]; otherwise, jquery=[ul > li:eq(1)].
            }
        }
    }

    public static final String URL_KEY = "demo.list.url";

    /* ---- Ul ---------------*/
    public void doClickList(int index) {
        def uid = String.format("ListExample.LinkList[%d]", index);
        click uid
        waitForPageToLoad 30000
    }

}
